package com.tsunade.spring6.autowired.service;

import com.tsunade.spring6.autowired.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Project ：learn_spring
 * @File ：UserServiceImpl.java
 * @IDE ：IntelliJ IDEA
 * @Author ：自由如风间
 * @Date ：2025/3/30 19:10
 * @Description ：For study.
 */

@Service
public class UserServiceImpl implements UserService {
    // 注入dao
    // @Autowired
    // private UserDao userDao;

    private UserDao userDao;

    // set方法注入
    @Autowired
    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    @Override
    public void add() {
        System.out.println("UserService add方法正在执行...");
        userDao.add();
    }
}
